package com.ruoyi.project.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mapper.HeEventBasicUndesirableMapper;
import com.ruoyi.project.domain.HeEventBasicUndesirable;
import com.ruoyi.project.service.IHeEventBasicUndesirableService;

/**
 * 药物不良事件药品Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-19
 */
@Service
public class HeEventBasicUndesirableServiceImpl implements IHeEventBasicUndesirableService 
{
    @Autowired
    private HeEventBasicUndesirableMapper heEventBasicUndesirableMapper;

    /**
     * 查询药物不良事件药品
     * 
     * @param id 药物不良事件药品主键
     * @return 药物不良事件药品
     */
    @Override
    public HeEventBasicUndesirable selectHeEventBasicUndesirableById(Long id)
    {
        return heEventBasicUndesirableMapper.selectHeEventBasicUndesirableById(id);
    }

    /**
     * 查询药物不良事件药品列表
     * 
     * @param heEventBasicUndesirable 药物不良事件药品
     * @return 药物不良事件药品
     */
    @Override
    public List<HeEventBasicUndesirable> selectHeEventBasicUndesirableList(HeEventBasicUndesirable heEventBasicUndesirable)
    {
        return heEventBasicUndesirableMapper.selectHeEventBasicUndesirableList(heEventBasicUndesirable);
    }

    /**
     * 新增药物不良事件药品
     * 
     * @param heEventBasicUndesirable 药物不良事件药品
     * @return 结果
     */
    @Override
    public int insertHeEventBasicUndesirable(HeEventBasicUndesirable heEventBasicUndesirable)
    {
        return heEventBasicUndesirableMapper.insertHeEventBasicUndesirable(heEventBasicUndesirable);
    }

    /**
     * 修改药物不良事件药品
     * 
     * @param heEventBasicUndesirable 药物不良事件药品
     * @return 结果
     */
    @Override
    public int updateHeEventBasicUndesirable(HeEventBasicUndesirable heEventBasicUndesirable)
    {
        heEventBasicUndesirable.setUpdateTime(DateUtils.getNowDate());
        return heEventBasicUndesirableMapper.updateHeEventBasicUndesirable(heEventBasicUndesirable);
    }

    /**
     * 批量删除药物不良事件药品
     * 
     * @param ids 需要删除的药物不良事件药品主键
     * @return 结果
     */
    @Override
    public int deleteHeEventBasicUndesirableByIds(Long[] ids)
    {
        return heEventBasicUndesirableMapper.deleteHeEventBasicUndesirableByIds(ids);
    }

    /**
     * 删除药物不良事件药品信息
     * 
     * @param id 药物不良事件药品主键
     * @return 结果
     */
    @Override
    public int deleteHeEventBasicUndesirableById(Long id)
    {
        return heEventBasicUndesirableMapper.deleteHeEventBasicUndesirableById(id);
    }
}
